package com.herench.bs.handler;

import com.herench.bs.annotation.Handler;
import com.herench.bs.support.AbstractMessageHandler;
import com.herench.bs.support.RequestMessage;
import com.herench.bs.support.ResponseMessage;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ThinkPad on 2018/3/8.
 */
@Component
@Handler(code = "100745" ,name="获取医保类型列表")
public class InsuranceTypeHandler extends AbstractMessageHandler {

    @Override
    protected ResponseMessage innerHandler(RequestMessage requestMessage) throws Exception {
        ResponseMessage responseMessage = new ResponseMessage(requestMessage.getId());
        String channelCode = requestMessage.getArgsPropertyStringValue("sysCode");
        List<Map<String, Object>> resultList = new ArrayList<>();
        if (channelCode.equals("100103")) {
            Map<String, Object> infoMap = new HashMap<>();
            Map<String, Object> parkMap = new HashMap<>();
            resultList.add(infoMap);
            resultList.add(parkMap);
            infoMap.put("insuranceTypeCode", "1");
            infoMap.put("insuranceType", "门诊普通病");
            parkMap.put("insuranceTypeCode", "2");
            parkMap.put("insuranceType", "门诊特殊病");
        }
        responseMessage.setDataAttribute("dataList", resultList);
        responseMessage.setCode("0");
        responseMessage.setMessage("请求成功");
        return responseMessage;
    }
}
